<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current">
        
        <header class="bar bar-nav fs-header-small">
          <a href="${ctx.host}/profile" class="icon icon-left pull-left"></a>
          <h1 class="title">个人信息</h1>
        </header>
        
        <div class="content">
          
          <div class="profile-banner">
          
            <div class="list-block" style="margin: .5rem 0;">
              <ul>
                <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">头像</div>
                    <div class="item-meta">
                      <img src="${user.profile.avatar}" style='width: 3rem; border-radius: 3rem;'>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
            
            <div class="list-block" style="margin: .5rem 0;">
              <ul>
                <li class="item-content">
                  <div class="item-inner">
                    <div class="item-title">昵称</div>
                    <div class="item-after">${user.profile.nickname}</div>
                  </div>
                </li>
                <c:choose>
                  <c:when test="${user.mobileBinded}">
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title">手机</div>
                        <div class="item-after">${user.mobile}</div>
                      </div>
                    </li>
                  </c:when>
                  <c:otherwise>
                    <li>
                      <a class="item-content item-link" href="#mobile-bind" data-toggle="push">
                        <div class="item-inner">
                          <div class="item-tile">手机：</div>
                          <div class="item-after">
                            请绑定手机号
                            <input type="hidden" name="contactMobile" value="">
                          </div>
                        </div>
                      </a>
                    </li>
                  </c:otherwise>
                </c:choose>
              </ul>
            </div>
            
            <!-- <div class="list-block" style="margin: .5rem 0;">
              <ul>
                <li>
                  <a href="#bmi-edit" class="item-content item-link" data-toggle="push">
                    <div class="item-inner">
                      <div class="item-title">BMI</div>
                      <div class="item-text">
                        <p style="margin: 0px; text-align: right;">24.99&nbsp;<span class="color-success">正常</span></p>
                        <p style="margin: 0px; text-align: right; color: #999;"><small>更新于2016-06-07</small></p>
                      </div>
                    </div>
                  </a>
                </li>
              </ul>
            </div> -->
            
            <div class="list-block" style="margin: .5rem 0;">
              <ul>
                <li>
                  <a href="#region-edit" class="item-content item-link" data-toggle="push">
                    <div class="item-inner">
                      <div class="item-title">所在地区</div>
                      <c:choose>
                        <c:when test="${user.profile.province eq user.profile.region}">
                          <div class="item-after">${user.profile.country}&nbsp;${user.profile.province}</div>
                        </c:when>
                        <c:otherwise>
                          <div class="item-after">${user.profile.country}&nbsp;${user.profile.province}&nbsp;${user.profile.region}</div>
                        </c:otherwise>
                      </c:choose>
                      
                    </div>
                  </a>
                </li>
                <li>
                  <a href="#address-edit" class="item-content item-link" data-toggle="push">
                    <div class="item-inner">
                      <div class="item-title">收货地址</div>
                      <div class="item-after">
                        <c:choose>
                          <c:when test="${not empty user.profile.address}">
                            去修改
                          </c:when>
                          <c:otherwise>
                            去设置
                          </c:otherwise>
                        </c:choose>
                      </div>
                    </div>
                  </a>
                </li>
              </ul>
            </div>
            
            <div class="list-block" style="margin: .5rem 0;">
              <p style="margin:1em;"><a href="javascript:void(0);" class="button button-fill button-danger button-big logout">退出登录</a></p>
            </div>
            
            <%-- <div class="list-block" style="margin: .5rem 0;">
              <ul>
                <li>
                  <a href="${ctx.host}/profile/investigation" class="item-content item-link" >
                    <div class="item-inner">
                      <div class="item-title">人马小调查</div>
                      <div class="item-after">让人马君更了解您</div>
                    </div>
                  </a>
                </li>
              </ul>
            </div> --%>
            
          </div>
          <!-- End banner -->
        </div>
        <!-- End Content -->
        
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/profile/info.js" />
    <script type="text/javascript">
      var jsConfig = JSON.parse('${wechatJsConfig}')
      require(['page/profile/info'], function(page) {
        page.init({
          jsConfig: jsConfig
        })
      })
    </script>
   
  </body>
</html>